package org.halo.trade.data.sina;


public class ZB
{
	public String symbol;// 证券代码
	public long sortid;
	public long time;// 时间，没有天
	public double price;
	public long vol;// 成交手
	public long buynum;// 成交手
	public long sellnum;// 成交手

	public int op;// // 方向

	// 'flag': ZBData[0] + '_' + ZBData[8],
	// 'flagClass': ZBData[7] == '0' ? 2 : 0,
	// 'type': ZBData[7] == '0' ? '卖出' : (ZBData[7] == '2' ? '买入' : '中性'),
	// 'style': me._getMoneyType(ZBData[2], ZBData[3], ZBData[7])

	static public final int OP_BUY = 1;// 买盘
	static public final int OP_SELL = -1;// 卖盘
	static public final int OP_PING = 0;// 中性盘

	public void print()
	{
		String opstr = op == ZB.OP_BUY ? "buy" : (op == ZB.OP_SELL ? "sell" : "ping");
		// System.out.println(sortid + "\t" + Utils.msToLongStr(time) + "\t" +
		// price + "\t" + num + "\t" + opstr);
		// System.out.println(Utils.msToLongStr(time) + "\t" + price + "\t" +
		// num + "\t" + opstr);

		int type = Utils.getMoneyType(price, vol);
		String type_str = "";
		if (type == 0 || type == 1)
		{
			type_str = Utils.getMoneyTypeString(type);
		}

		System.out.println(Utils.msToLongStr(time) + "\t" + symbol + "\t" + price + "\t" + vol + "\t" + opstr + "\t" + type_str);
	}
}
